package com.ship.dispatch.controller;

import com.ship.common.core.web.domain.JsonResult;
import com.ship.common.log.annotation.Log;
import com.ship.common.log.enums.BusinessType;
import com.ship.dispatch.model.SpYearlyPlanModel;
import com.ship.dispatch.model.dto.SyNewRecordDto;
import com.ship.dispatch.service.SyNewRecordService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sy/new/record")
@Api(value = "SyNewRecord", tags = "首页新闻")
public class SyNewRecordController {

    @Autowired
    private SyNewRecordService newRecordService;

    /**
     * 新增新闻
     *
     * @param newRecordDto
     * @return
     */
    @PostMapping("/saveNewRecord")
    @Log(title = "新增新闻", businessType = BusinessType.INSERT)
    public JsonResult saveNewRecord(@RequestBody SyNewRecordDto newRecordDto) {
        newRecordService.saveNewRecord(newRecordDto);
        return JsonResult.success();
    }

}
